package com.example.smartcity.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.smartcity.R;

public class MainActivity2 extends AppCompatActivity {
    Button dialButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        dialButton = findViewById(R.id.btn);
        dialButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String phoneNumber = "19543902394";
                Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phoneNumber));
                Intent intent1 = new Intent(Intent.ACTION_SEND,Uri.parse("www.baidu.com"));
                startActivity(intent);
            }
        });
    }
}